package test_3_7;

import java.util.Random;

public class nine {
    /*在同一个类中定义多个方法：
    要求不仅可以求2个整数的最大值，
    还可以求3个小数的最大值？*/
    public static void main(String[] args) {
        Random R=new Random();
        int a= R.nextInt(19);
        int b=R.nextInt(19);
        int c=R.nextInt(19);
        int d=R.nextInt(19);
        System.out.println(a);
        System.out.println(b);
        System.out.println(c);
        System.out.println(d);
        System.out.println(max(a,b));
        System.out.println(max(a,b,c));
        System.out.println(max(a,b,c,d));
    }
    public static int max(int a,int b)
    {
        return (a>b?a:b);
    }
    public static int max(int a,int b,int c)
    {
        return ((a>b?a:b)<c?c:(a>b?a:b));
    }
    public static int max(int a,int b,int c,int d)
    {
       int sum= max(a,b,c);
        return sum>c?sum:c;
    }
}
